package com.wmh.baseservice.operationaid.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.wmh.baseservice.common.mybatisplus.structure.LambdaQueryWrapperX;
import com.wmh.baseservice.operationaid.entity.ProductTrafficSourceOptions;
import com.wmh.baseservice.operationaid.pojo.vo.productTrafficSourceOptions.ProductTrafficSourceOptionQueryReqVO;

import java.util.List;

/**
* @author 谢骏
* @description 针对表【operation_aid_product_trafficsource_options(运营助手-商品数据-流量来源-选项)】的数据库操作Mapper
* @createDate 2023-07-21 16:33:53
* @Entity generator.domain.ProductTrafficSourceOptions
*/
public interface ProductTrafficSourceOptionsMapper extends BaseMapper<ProductTrafficSourceOptions> {

    /**
     * 返回不包含基础字段的列表
     * @return 列表
     */
    default List<ProductTrafficSourceOptions> selectListNotBaseField(ProductTrafficSourceOptionQueryReqVO reqVO){
        return selectList(new LambdaQueryWrapperX<ProductTrafficSourceOptions>()
                .likeIfPresent(ProductTrafficSourceOptions::getName, reqVO.getName())
                .orderByDesc(ProductTrafficSourceOptions::getCreateTime)
                .select(ProductTrafficSourceOptions::getId,
                        ProductTrafficSourceOptions::getName,
                        ProductTrafficSourceOptions::getParentId));
    }

}




